Linux VIM 最佳配置
1 背景知识
对于VIM 需要自定义一些适合自己的配置,以下就是经过实践后的一些配置。
2 vimrc 环境
" vim 官方配置
" 1.设置<TAB> 的格式.
set shiftwidth=4
set softtabstop=4
" 2. 设置补全方式
set wildmode=longest,list
" 3. 保留命令的历史长度.
set history=2000
" 4. map 映射键
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
" 5.设置不兼容模式
set nocompatible " be iMproved, required
" 6.打开自动文件高亮
filetype on " required
" 7. 设置缓存区的是否能够被隐藏.
"
set hidden
" 8. 设置打开文件时的快捷路径
cnoremap <expr> %% getcmdtype( ) == ':' ? expand('%:h').'/' : '%%'
" 9.跳转增强插件
runtime macros/matchit.vim
" 10.设置常用shell
set shell=/bin/bash
" Vbundle 插件 Plugin 管理插件
" :h Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
call vundle#end() " required
filetype plugin indent on " required
Plugin 'VundleVim/Vundle.vim'
" 表格自动格式化插件
Plugin 'godlygeek/tabular'
" 快捷键插件
Plugin 'tpope/vim-unimpaired'
" find 的增强插件
Plugin 'tpope/vim-rails'
" 成对出现的符号添加\删除插件
Plugin 'tpope/vim-surround'
" sql code surround
let g:surround_113 = "```sql \n \r \n```"
let g:surround_115 = "```console \n \r \n```"
let g:surround_105 = "::: alert-info \n \r \n:::"
let g:surround_100 = "::: alert-danger \n \r \n:::"
let g:surround_119 = "::: alert-warning \n \r \n:::"
let g:surround_114 = ">>> \n \r \n>>>"
"""""""""""""""""" shell 编写IDE""""""""""""""""""""""
Plugin 'WolfgangMehner/bash-support'
"""""""""""""""""" awk 编写IDE""""""""""""""""""""""
Plugin 'WolfgangMehner/awk-support'
""""""""""""""" markdown """""""""""""""""""""""""'
Plugin 'vim-voom/VOoM'
"1. 根据文件类型进行自动窗口打开
let g:voom_ft_modes = {'markdown': 'markdown', 'tex': 'latex'}